//Francisco "Kiko" Olvera
//handles input from keyboard and mouse
//input.h

#pragma once
#include "DX include.h"

class Input
{
private:
	IDirectInput8 * m_pDIObject;
	IDirectInputDevice8 * m_pDIKeyboard, * m_pDIMouse;
	DIMOUSESTATE2 mouseState;
	char buffer[256];
	bool key[256];
	bool mDown;
	HWND wndHandle;
public:
	void init(HWND, HINSTANCE);
	void Update();
public:
	//keyboard
	//returns keyboard ups and downs
	inline char* getKeyboard(){return buffer;}
	//return last key ups or downs
	//for determining if button is being held down
	inline bool* getKeyboardLast(){return key;}
	//individual keys
	bool KeyPressed(int);
	bool KeyDown(int);
public:
	//mouse
	//returns buttons down or up
	inline DIMOUSESTATE2 getMouseState(){return mouseState;}
	//returns mouse pos in screen coord
	POINT getMousePosition();
	bool leftClicked();
	bool rightClicked();
};